package com.baor.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baor.domain.Equipment_clean;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Equipment_cleanDao extends BaseMapper<Equipment_clean> {
    /**
     * 根据设备ID列表查询清理人员关联关系
     */

    @Select("<script>" +
            "SELECT equipment_id, clean_id FROM equipment_clean WHERE equipment_id IN " +
            "<foreach collection='equipmentIds' item='id' open='(' separator=',' close=')'>" +
            "#{id}" +
            "</foreach> AND is_deleted = '0'" +
            "</script>")
    List<Equipment_clean> selectByEquipmentIds(@Param("equipmentIds") List<Integer> equipmentIds);

    int insertBatch(List<Equipment_clean> equipmentCleanList);
    // 根据设备ID删除清理人员关联记录
    int deleteByEquipmentId(Integer equipmentId);

    List<Equipment_clean> selectByEquipmentId(Integer equipmentId);
}
